package longcaisuyun.longcai.com.yiliubabalongcaisuyun;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import java.util.List;

import longcaisuyun.longcai.com.suyunbean.MonthBean;



/**
 * Created by Administrator on 2016/2/22.
 */
public class MonthAdapter  extends BaseAdapter {
    ViewHolder   vh;
    Context  context;
    List<MonthBean>list;
    public   MonthAdapter(Context  context,List<MonthBean>list){
        this.context=context;
        this.list=list;
    }

    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
    if(convertView==null){
        vh=new ViewHolder();
        convertView=View.inflate(context, R.layout.item_month,null);
        MyApplication.ScaleScreenHelper.loadView((ViewGroup) convertView);
        vh.tv_1= (TextView) convertView.findViewById(R.id.t_time);
        vh.tv_2= (TextView) convertView.findViewById(R.id.t_money);
        convertView.setTag(vh);
    }else{
      vh= (ViewHolder) convertView.getTag();
    }
        vh.tv_1.setText(list.get(position).getPosttime());
        vh.tv_2.setText(list.get(position).getMoney()+"元");
        return convertView;
    }
    class ViewHolder{
        TextView   tv_1;
        TextView   tv_2;
    }
}
